package com.konne.nightmare.FastPublicOpinion.ui.information.adapter;

import androidx.annotation.Nullable;

import com.blankj.utilcode.util.SizeUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.bean.MembersBean;
import com.shehuan.niv.NiceImageView;

import java.util.List;

import jp.wasabeef.glide.transformations.RoundedCornersTransformation;

/**
 * Create by ws.
 * on Data:2022/1/25  Time:下午 5:46.
 * description: ** .
 */
public class CGMStudentAdapter extends BaseQuickAdapter<MembersBean, BaseViewHolder> {
    public CGMStudentAdapter( @Nullable List<MembersBean> data) {
        super(R.layout.item_menbers_user, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MembersBean item) {
        helper.setText(R.id.tv_name, item.getName())
                .setVisible(R.id.stv_tag, false)
                .setVisible(R.id.stv_chat, false);
        NiceImageView avatar = helper.getView(R.id.ic_avatar);
        Glide.with(avatar).load(item.getAvatar()).apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(SizeUtils.dp2px(20),0))).into(avatar);
    }
}
